﻿using Microsoft.EntityFrameworkCore.Metadata.Internal;
using MyProject.Core;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Runtime.CompilerServices;

namespace MyProject.Entities.Auth
{
    public class Auth: NotifyPropertyChanged
    {
        [Required(ErrorMessage = "Поле является обязательным"), MaxLength(20), EmailAddress(ErrorMessage = "Не верный формат логина")]
        public string? Login { get; set; }

        [Required(ErrorMessage = "Поле является обязательным"), MaxLength(20)]
        public string? Password { get; set; }

        public void ClearPassword()
        {
            this.Password = null;
            this.NotifyPropChanged(nameof(Password));
        }
    }
}
